# 导入所需的包
from selenium import webdriver
from time import sleep
# 导入定位元素的类
from selenium.webdriver.common.by import By
# 获取火狐浏览器驱动对象
driver = webdriver.Firefox()
# 打开注册页面
url = 'file:///root/NSD2408/html/registerA.html'
driver.get(url)
# 通过ID属性定位页面中的元素
# 查找id属性值为userA的元素
username = driver.find_element(By.ID, 'userA')
# 往元素中输入值
username.send_keys('admin')
# 通过ID定位页面中密码框，电话，邮箱，并输入对应的值
password = driver.find_element(By.ID, 'passwordA')
password.send_keys('123456')
tel = driver.find_element(By.ID, 'telA')
tel.send_keys('18812345678')
email = driver.find_element(By.ID, 'emailA')
email.send_keys('123@qq.com')

# 停顿3秒钟
sleep(3)
# 关闭浏览器驱动
driver.quit()